package com.huawei.hms.auth.api.signin.internal;

import android.text.TextUtils;
import com.huawei.hms.auth.api.signin.internal.c.a;
import com.huawei.hms.auth.api.signin.internal.c.b;
import com.huawei.hms.common.ApiException;
import com.huawei.hms.common.internal.AnyClient;
import com.huawei.hms.common.internal.ResponseErrorCode;
import com.huawei.hms.common.internal.TaskApiCall;
import com.huawei.hms.support.api.client.Status;
import com.huawei.hms.support.api.entity.hwid.HwIDNaming;
import com.huawei.hms.support.api.hwid.RevokeAccessResult;
import com.huawei.hms.support.hianalytics.HiAnalyticsClient;
import com.huawei.hms.support.log.HMSLog;
import o.fjx;

public class d extends TaskApiCall<b, Void> {
    public /* synthetic */ void doExecute(AnyClient anyClient, ResponseErrorCode responseErrorCode, String str, fjx o_fjx) {
        a((b) anyClient, responseErrorCode, str, o_fjx);
    }

    public d(String str, String str2, String str3) {
        super(str, str2, str3);
    }

    protected void a(b bVar, ResponseErrorCode responseErrorCode, String str, fjx<Void> o_fjx_java_lang_Void) {
        int errorCode;
        HMSLog.i("HuaweiIdRevokeAccessTaskApiCall", "HuaweiIdRevokeAccessTaskApiCall doExecute");
        i.a();
        int i = 0;
        if (TextUtils.isEmpty(str)) {
            errorCode = responseErrorCode.getErrorCode();
            o_fjx_java_lang_Void.ॱ(new ApiException(new Status(responseErrorCode.getErrorCode(), responseErrorCode.getErrorReason())));
        } else {
            RevokeAccessResult beanFromJsonStr = new RevokeAccessResult().getBeanFromJsonStr(str);
            if (beanFromJsonStr.getErrorCode() != null) {
                i = beanFromJsonStr.getErrorCode().intValue();
                o_fjx_java_lang_Void.ॱ(new ApiException(new Status(beanFromJsonStr.getErrorCode().intValue(), beanFromJsonStr.getErrorMsg())));
            } else {
                o_fjx_java_lang_Void.ॱ(null);
            }
            errorCode = i;
        }
        HiAnalyticsClient.reportExit(bVar.getContext(), HwIDNaming.revokeAccess, getTransactionId(), b.a(errorCode), errorCode, a.a());
    }
}
